package com.example.shop.pojo;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
* <p>
* 对商品的评价
* </p>
*
* @author 作者
* @since 2022-05-29
*/
@Getter
@Setter
@Accessors(chain = true)
public class Evaluation extends Model<Evaluation> {

  private static final long serialVersionUID = 1L;

  @TableId(value = "evaluation_id", type = IdType.ASSIGN_ID)
  //该评价的唯一标识
  private Long evaluationId;
  @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
  //进行评价的用户id
  private Long userId;

  @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
  //被评价的商品
  private Long goodsId;

  @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
  //购买该商品的订单
  private Long orderId;
  //评价类型（好中差）
  private String evaluationType;
  //评论的视频
  private String evaluationVideo;
  //评价内容
  private String evaluationContent;
  //评价的日期
  private LocalDate evaluationDate;

  @Override
  public String toString() {
    return "Evaluation{" +
            "evaluationId=" + evaluationId +
            ", userId=" + userId +
            ", goodsId=" + goodsId +
            ", orderId=" + orderId +
            ", evaluationType='" + evaluationType + '\'' +
            ", evaluationVideo='" + evaluationVideo + '\'' +
            ", evaluationContent='" + evaluationContent + '\'' +
            ", evaluationDate=" + evaluationDate +
            '}';
  }
}
